#ifndef PREPARE_H
#define PREPARE_H

#include <QObject>
#include <QDebug>
#include <QSqlDatabase>
#include <QSqlQuery>
#include <QStringList>
#include <QMap>
#include <QDateTime>

#include <QFile>
#include <item.h>

class Prepare : public QObject
{
    Q_OBJECT
public:
    explicit Prepare(QObject *parent = 0);
    ~Prepare();
    void getResultList();

private:
    enum Smena{First,Second,Third, Fourth};
    struct searchL
    {
        int id;
        QString design;
        QString type;
        QString unit;

    };
    int databaseUp();
    int listMrParser();
    QList<float> averageVal(const QString&, const short int&);
    bool kHealthy();
    bool chGood();
    int buildResult();
    int buildWatchMap();
    QList<QDateTime> timeKnow();
    QList<searchL> SearchList;
    QList<QList<Item>> resultList;
    Smena smena;
    QList<QDateTime> smenaTime;
    QSqlDatabase db;
    QDateTime dateTime;  
    QList<QList<QString>> kontrolersLists;
    QList<QMap<QString,QString>> descList;
    QList<QMap<QString,int>> typeList;
    QList<QMap<QString,QList<short int>>> itemList;
    QString srvNam;
    QString dbNam;
    QString srvPass;

signals:
    void result( QList<QList<Item>>) ;
public slots:

};

#endif // PREPARE_H
